home *** CD-ROM | disk | FTP | other *** search
/ Leonardo the Inventor / Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso / LEOWINMV / SHARED.DIR / 03105_Script_PC PRINT LEO II < prev    next >
Text File  |  1996-04-01  |  4KB  |  136 lines

  1. -- --------------------------------------------------------------------------------------
  2. -- Handler printScreenPC prints a screenShot of the current 13" screen
  3. -- (640 wide by 480 tall), scaled up to fit an 11 x 8.5 inch page...
  4. -- (not recommended for monitors/windows smaller than 640 x 480 at this time):
  5. -- If printSize is "card", it prints 4 cards on the page. Otherwise, it prints
  6. -- on screenshot.
  7.  
  8. on printScreenPC printSize
  9.   if (printSize = "card") then
  10.     printCardSizePC
  11.   else if (printSize = "full") then
  12.     printFullSizePC
  13.   end if
  14. end
  15.  
  16. -----------------------------------------------------------------------
  17. -- Handler printFullSizePC 
  18.  
  19. on printFullSizePC fullFileName
  20.   -- 1) open the xobject
  21.   openXObjHandler "pmatic.dll"
  22.   
  23.   -- 2) create a new object
  24.   set printObj = printomatic(mnew)
  25.   
  26.   if not(objectP( printObj )) then
  27.     alert "Sorry...Error in printing."
  28.     exit
  29.   end if
  30.   
  31.   -- 3) call the print function to print
  32.   doPrintFullScreen(printObj, fullFileName)
  33.   
  34.   -- 4) close the xojbect
  35.   closeXObjHandler "pmatic.dll"
  36. end
  37.  
  38. -- --------------------------------------------------------------------------------------
  39. -- Handler printFilePC 
  40.  
  41. on printFilePC printSize, fullFileName
  42.   if (printSize = "card") then
  43.     printCardSizePC(fullFileName)
  44.   else if (printSize = "full") then
  45.     printFullSizePC(fullFileName)
  46.   end if
  47. end
  48.  
  49. -- --------------------------------------------------------------------------------------
  50. -- Handler printAllCardsPC 
  51.  
  52. on printAllCardsPC filePathName
  53.   -- 1) open the xobject
  54.   openXObjHandler "pmatic.dll"
  55.   
  56.   -- 2) call the printing function (this one creates and disposes)
  57.   doPrintAllCards(filePathName)
  58.   
  59.   -- 3) close the xojbect
  60.   closeXObjHandler "pmatic.dll"
  61. end
  62.  
  63. -- ----------------------------------------------------------------
  64. -- Handler printDatabasePC is called when the user clicks the print
  65. -- button in the database. It prints the text or picture (whichever
  66. -- is currently displayed) of the currently selected topic.
  67.  
  68. on printDatabasePC
  69.   global textButton, pictureButton
  70.   
  71.   -- 1) open the xobject
  72.   openXObjHandler "pmatic.dll"
  73.   
  74.   -- 2) create a new object
  75.   set printObj = printomatic(mnew)
  76.   
  77.   if not(objectP( printObj )) then
  78.     alert "Sorry...Error in printing."
  79.     exit
  80.   end if
  81.   
  82.   -- 3) call the print function to print
  83.   if isActivated(textButton) then
  84.     doPrintDatabaseText(printObj)
  85.   else if isActivated(pictureButton) then
  86.     doPrintDatabasePicture(printObj)
  87.   end if
  88.   
  89.   -- 4) close the xojbect
  90.   closeXObjHandler "pmatic.dll"
  91. end
  92.  
  93. -- -----------------------------------------------------------
  94. -- Handler printCardSizePC prints four of the current screen on a 
  95. -- landscape page.
  96.  
  97. on printCardSizePC fullFileName
  98.   -- 1) open the xobject
  99.   openXObjHandler "pmatic.dll"
  100.   
  101.   -- 2) create a new object
  102.   set printObj = printomatic(mnew)
  103.   
  104.   if not(objectP( printObj )) then
  105.     alert "Sorry...Error in printing."
  106.     exit
  107.   end if
  108.   
  109.   -- 3) call the print function to print
  110.   doPrintCardSize(printobj, fullFileName)
  111.   
  112.   -- 4) close the xojbect
  113.   closeXObjHandler "pmatic.dll"
  114. end
  115.  
  116. -- -----------------------------------------------------------
  117. -- Handler printPicturePC  
  118.  
  119. on printPicturePC printSize, whichCast, title, caption
  120.   -- 1) open the xobject
  121.   openXObjHandler "pmatic.dll"
  122.   
  123.   -- 2) create a new object
  124.   set printObj = printomatic(mnew)
  125.   
  126.   if not(objectP( printObj )) then
  127.     alert "Sorry...Error in printing."
  128.     exit
  129.   end if
  130.   
  131.   -- 3) call the print function to print
  132.   doPrintPicture(printObj, whichCast, title, caption) 
  133.   
  134.   -- 4) close the xojbect
  135.   closeXObjHandler "pmatic.dll"
  136. end